package libary;

public class Literature extends Book{
    public Literature() {
    }

    public Literature(String name) {
        super(name, 14);
    }

    @Override
    public double calFines(int borrowingDays) {
        int delay = borrowingDays-super.getBorrowingPeriod();
        double fines;
        if (delay<=0){ // 没有延期
            fines = 0;
        }else if (delay<=3){ // 延期3天以内 每天5元
            fines = delay*5;
        }else{ // 延期3天以内 每天5元 超出3天 每天10元
            fines = 3*5+(delay-3)*10;
        }
        return fines;
    }
}
